import request from "@/utils/request";

// 分页
export function pageData(params){
    return request({
        url:'/tRoleRest/page',
        method:'get',
        params
    })
}


export function allRole(params){
  return request({
    url:'/tRoleRest/allRole',
    method:'get',
    params
  })
}

export function create(data){
    return request({
        url:'/tRoleRest/create',
        method:'post',
        data
    })
}


export function update(data){
    return request({
        url:'/tRoleRest/update',
        method:'put',
        data
    })
}


export function removeById(id){
    return request({
      url: `/tRoleRest/remove?id=${id}`,
      method: 'delete',
    })
}


export function updateRolePermission(data){
  return request({
    url:'/tRoleRest/updateRolePermission',
    method:'put',
    data
  })
}

export function loadRolePermissions(roleId){
  return request({
    url:`/tRoleRest/listRolePermission/${roleId}`,
    method:'get',
  })
}
